class Solution(object):

    def twoSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[int]
        """

        res_list = []
        for x in nums:
            for y in nums[nums.index(x) + 1:]:
                if x + y == target:
                    a = nums.index(x)
                    b = nums[nums.index(x) + 1:].index(y) + a + 1
        res_list.append(a)
        res_list.append(b)
        return res_list

print(Solution().twoSum(([2,7,11,15]), 9))
